home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / DriverFamilyMatching.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  6.9 KB  |  215 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        DriverFamilyMatching.h
  3.  
  4.      Contains:    Interfaces for create native drivers NDRV
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DRIVERFAMILYMATCHING__
  18. #define __DRIVERFAMILYMATCHING__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __NAMEREGISTRY__
  25.     #include <NameRegistry.h>
  26. #endif
  27.  
  28. #ifndef __CODEFRAGMENTS__
  29.     #include <CodeFragments.h>
  30. #endif
  31.  
  32.  
  33.  
  34.  
  35. #if PRAGMA_ONCE
  36. #pragma once
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. #if PRAGMA_IMPORT
  44. #pragma import on
  45. #endif
  46.  
  47. #if PRAGMA_STRUCT_ALIGN
  48.     #pragma options align=mac68k
  49. #elif PRAGMA_STRUCT_PACKPUSH
  50.     #pragma pack(push, 2)
  51. #elif PRAGMA_STRUCT_PACK
  52.     #pragma pack(2)
  53. #endif
  54.  
  55. /*
  56.   ##############################################
  57.    Well known properties in the Name Registry
  58.   ##############################################
  59. */
  60.  
  61. #define kPropertyName                    "name"
  62. #define kPropertyCompatible                "compatible"
  63. #define    kPropertyDriverPtr                "driver-ptr"
  64. #define kPropertyDriverDesc                "driver-description"
  65. #define kPropertyReg                    "reg"
  66. #define kPropertyAAPLAddress            "AAPL,address"
  67. #define kPropertyMatching                "matching"
  68. #define kPropertyAAPLDriverName            "AAPL,driver-name"
  69.  
  70. /* CPassThru */
  71. /*
  72.   #########################################################
  73.    Descriptor for Drivers and NDRVs
  74.   #########################################################
  75. */
  76. /* 
  77.     QuickTime 3.0: "DriverType" has a name collision with cross-platform code.
  78.     Use Mac prefix to avoid collision 
  79. */
  80. /* Driver Typing Information Used to Match Drivers With Devices */
  81.  
  82. struct MacDriverType {
  83.     Str31                             nameInfoStr;                /* Driver Name/Info String*/
  84.     NumVersion                         version;                    /* Driver Version Number*/
  85. };
  86. typedef struct MacDriverType            MacDriverType;
  87. #if TARGET_OS_MAC
  88.  
  89. typedef MacDriverType                     DriverType;
  90. #endif  /* TARGET_OS_MAC */
  91.  
  92. typedef MacDriverType *                    DriverTypePtr;
  93. /* OS Runtime Information Used to Setup and Maintain a Driver's Runtime Environment */
  94. typedef OptionBits                         RuntimeOptions;
  95. enum {
  96.     kDriverIsLoadedUponDiscovery = 0x00000001,                    /* auto-load driver when discovered*/
  97.     kDriverIsOpenedUponLoad        = 0x00000002,                    /* auto-open driver when loaded*/
  98.     kDriverIsUnderExpertControl    = 0x00000004,                    /* I/O expert handles loads/opens*/
  99.     kDriverIsConcurrent            = 0x00000008,                    /* supports concurrent requests*/
  100.     kDriverQueuesIOPB            = 0x00000010,                    /* device manager doesn't queue IOPB*/
  101.     kDriverIsLoadedAtBoot        = 0x00000020,                    /* Driver is loaded at the boot time */
  102.     kDriverIsForVirtualDevice    = 0x00000040,                    /* Driver is for a virtual Device */
  103.     kDriverSupportDMSuspendAndResume = 0x00000080                /* Driver supports Device Manager Suspend and Resume command */
  104. };
  105.  
  106.  
  107. struct DriverOSRuntime {
  108.     RuntimeOptions                     driverRuntime;                /* Options for OS Runtime*/
  109.     Str31                             driverName;                    /* Driver's name to the OS*/
  110.     UInt32                             driverDescReserved[8];        /* Reserved area*/
  111. };
  112. typedef struct DriverOSRuntime            DriverOSRuntime;
  113. typedef DriverOSRuntime *                DriverOSRuntimePtr;
  114. /* OS Service Information Used To Declare What APIs a Driver Supports */
  115.  
  116. typedef UInt32                             ServiceCount;
  117.  
  118. struct DriverServiceInfo {
  119.     OSType                             serviceCategory;            /* Service Category Name*/
  120.     OSType                             serviceType;                /* Type within Category*/
  121.     NumVersion                         serviceVersion;                /* Version of service*/
  122. };
  123. typedef struct DriverServiceInfo        DriverServiceInfo;
  124. typedef DriverServiceInfo *                DriverServiceInfoPtr;
  125.  
  126. struct DriverOSService {
  127.     ServiceCount                     nServices;                    /* Number of Services Supported*/
  128.     DriverServiceInfo                 service[1];                    /* The List of Services (at least one)*/
  129. };
  130. typedef struct DriverOSService            DriverOSService;
  131. typedef DriverOSService *                DriverOSServicePtr;
  132. /* Categories */
  133. enum {
  134.     kServiceCategoryDisplay        = FOUR_CHAR_CODE('disp'),        /* Display Manager*/
  135.     kServiceCategoryOpenTransport = FOUR_CHAR_CODE('otan'),        /* Open Transport*/
  136.     kServiceCategoryBlockStorage = FOUR_CHAR_CODE('blok'),        /* Block Storage*/
  137.     kServiceCategoryNdrvDriver    = FOUR_CHAR_CODE('ndrv'),        /* Generic Native Driver*/
  138.     kServiceCategoryScsiSIM        = FOUR_CHAR_CODE('scsi'),        /* SCSI */
  139.     kServiceCategoryFileManager    = FOUR_CHAR_CODE('file'),        /* File Manager */
  140.     kServiceCategoryIDE            = FOUR_CHAR_CODE('ide-'),        /* ide */
  141.     kServiceCategoryADB            = FOUR_CHAR_CODE('adb-'),        /* adb */
  142.     kServiceCategoryPCI            = FOUR_CHAR_CODE('pci-'),        /* pci bus */
  143.                                                                 /* Nu Bus */
  144.     kServiceCategoryDFM            = FOUR_CHAR_CODE('dfm-'),        /* DFM */
  145.     kServiceCategoryMotherBoard    = FOUR_CHAR_CODE('mrbd'),        /* mother Board */
  146.     kServiceCategoryKeyboard    = FOUR_CHAR_CODE('kybd'),        /* Keyboard */
  147.     kServiceCategoryPointing    = FOUR_CHAR_CODE('poit'),        /* Pointing */
  148.     kServiceCategoryRTC            = FOUR_CHAR_CODE('rtc-'),        /* RTC */
  149.     kServiceCategoryNVRAM        = FOUR_CHAR_CODE('nram'),        /* NVRAM */
  150.     kServiceCategorySound        = FOUR_CHAR_CODE('sond'),        /* Sound (1/3/96 MCS) */
  151.     kServiceCategoryPowerMgt    = FOUR_CHAR_CODE('pgmt'),        /* Power Management */
  152.     kServiceCategoryGeneric        = FOUR_CHAR_CODE('genr')        /* Generic Service Category to receive general Events */
  153. };
  154.  
  155. /* Ndrv ServiceCategory Types */
  156. enum {
  157.     kNdrvTypeIsGeneric            = FOUR_CHAR_CODE('genr'),        /* generic*/
  158.     kNdrvTypeIsVideo            = FOUR_CHAR_CODE('vido'),        /* video*/
  159.     kNdrvTypeIsBlockStorage        = FOUR_CHAR_CODE('blok'),        /* block storage*/
  160.     kNdrvTypeIsNetworking        = FOUR_CHAR_CODE('netw'),        /* networking*/
  161.     kNdrvTypeIsSerial            = FOUR_CHAR_CODE('serl'),        /* serial*/
  162.     kNdrvTypeIsParallel            = FOUR_CHAR_CODE('parl'),        /* parallel */
  163.     kNdrvTypeIsSound            = FOUR_CHAR_CODE('sond'),        /* sound*/
  164.     kNdrvTypeIsBusBridge        = FOUR_CHAR_CODE('brdg'),
  165.     kNdrvTypeIsFWConference        = FOUR_CHAR_CODE('crsh'),        /* FireWire conference camera */
  166.     kNdrvTypeIsAVC                = FOUR_CHAR_CODE('avc ')        /* FireWire AVC devices (DV cameras) */
  167. };
  168.  
  169.  
  170. typedef UInt32                             DriverDescVersion;
  171. /*    The Driver Description */
  172. enum {
  173.     kTheDescriptionSignature    = FOUR_CHAR_CODE('mtej'),
  174.     kDriverDescriptionSignature    = FOUR_CHAR_CODE('pdes')
  175. };
  176.  
  177. enum {
  178.     kInitialDriverDescriptor    = 0,
  179.     kVersionOneDriverDescriptor    = 1
  180. };
  181.  
  182.  
  183. struct DriverDescription {
  184.     OSType                             driverDescSignature;        /* Signature field of this structure*/
  185.     DriverDescVersion                 driverDescVersion;            /* Version of this data structure*/
  186.     MacDriverType                     driverType;                    /* Type of Driver*/
  187.     DriverOSRuntime                 driverOSRuntimeInfo;        /* OS Runtime Requirements of Driver*/
  188.     DriverOSService                 driverServices;                /* Apple Service API Membership*/
  189. };
  190. typedef struct DriverDescription        DriverDescription;
  191. typedef DriverDescription *                DriverDescriptionPtr;
  192.  
  193.  
  194.  
  195. #if PRAGMA_STRUCT_ALIGN
  196.     #pragma options align=reset
  197. #elif PRAGMA_STRUCT_PACKPUSH
  198.     #pragma pack(pop)
  199. #elif PRAGMA_STRUCT_PACK
  200.     #pragma pack()
  201. #endif
  202.  
  203. #ifdef PRAGMA_IMPORT_OFF
  204. #pragma import off
  205. #elif PRAGMA_IMPORT
  206. #pragma import reset
  207. #endif
  208.  
  209. #ifdef __cplusplus
  210. }
  211. #endif
  212.  
  213. #endif /* __DRIVERFAMILYMATCHING__ */
  214.  
  215.